package cloud.simple.service.controller;

import cloud.simple.service.manage.UserService;
import cloud.simple.service.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by feng on 16/9/18.
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 获取所有用户
     *
     * @return
     */
    @RequestMapping(value = "/users", method = RequestMethod.GET)
    public List<User> findAll() {
        List<User> users = userService.findAll();
        return users;
    }
}
